{include file = $admin_header1}
{include file = $admin_header2}
{include file = $admin_leftsidebar}

<div class="middel_panel">
<h1 class="type2">{if 0 lt $advertisement->getId()}Edit{else}Add{/if} Advertisement</h1>
<div class="holdthisTop">
      {if 0 lt $error_messages|@count}
      	<div align="center" class="error" style='border:2px red;font-size:12px; '>
      	<ul>
		{foreach item=error_message from=$error_messages}
			<li style="padding:5px 5px 5px 10px;text-align:left;">{$error_message}</li>
		{/foreach}
		</ul>
		</div>
		<div class='clr'></div>
	{/if}
  <table width="100%"  align="center">
    <tr>
      <td>
        <form name="frmAdvertisement" method="post" action="{$site_path}/admin/advertisement/insert_update_advertisement" enctype="multipart/form-data" >
          <input type="hidden" name="advertisement[id]" id="advertisement_id" value="{$advertisement->getId()}" />
          <table width="100%"  border="0" cellpadding="6" cellspacing="2" class="datagrid">
            
            <tr>
              <td valign="top" align="right" >Category: </td>
              <td valign="top"><select name="advertisement[module_id]" id="advertisement_category">
       
              {foreach item=advertisement_categorie from=$advertisement_categories}
                  <option value="{$advertisement_categorie->getId()}"selected="selected">{$advertisement_categorie->getCategory()}</option>
              {/foreach}
              </select></td>
            </tr>
            
              <tr>
            
              <td valign="top" align="right" >Advertisement Type: </td>
              <td valign="top"><select name="advertisement[advertisement_type_id]" id="advertisement_type">
              {foreach item=advertisement_type from=$advertisement_types}
                  <option value="{$advertisement_type->getId()}"selected="selected">{$advertisement_type->getType()}</option>
              {/foreach}
              </select></td>
            </tr>
            
             <tr>
				<td valign="top" align="right">Advertisement Image:</td>
				<td>
         		  <input type="file" name="file" id="file" value=""/>
            	</td>
			</tr>
			
			<tr>
              <td width="10%" align="right" valign="top">Advertisement Url</td>
              <td align="left">
				<input type="text" name="advertisement[url]" id="advertisement_url"  style="width:50%" value="{$advertisement->getUrl()}"/></td>
             </tr>	
      
            <tr>
              <td align="right" valign="top"></td>
              <td>
					<div class="buttons">	
						<input type="submit" name="Submit" value="{if 0 lt $advertisement->getId()}Update{else}Save{/if}" class="button1" />
					</div>
               		<div class="buttons">
               			<input type="button" name="Cancel" value="Cancel" class="button1" onclick="javascript: history.back();" />
               		</div>
               </td>
            </tr>
          </table>
        </form></td>
    </tr>
  </table>
</div>
</div>
								<!--middel panel ends -->
                  </div>
                  <!--main content ends -->
                  <!--content ends -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      </div>
    </div>
    <!--Banner ends -->
  </div>
  <!--    content area ends -->
{include file = $admin_footer}